package com.addzero.kmp.entity.low_table

/**
 * 验证规则
 */
sealed class ValidationRule {
    data class Required(val message: String = "此字段为必填项") : ValidationRule()
    data class MinLength(val length: Int, val message: String = "最小长度为 $length") : ValidationRule()
    data class MaxLength(val length: Int, val message: String = "最大长度为 $length") : ValidationRule()
    data class Email(val message: String = "请输入有效的邮箱地址") : ValidationRule()
    data class Pattern(val regex: Regex, val message: String) : ValidationRule()
    data class Custom(val validator: (Any?) -> Boolean, val message: String) : ValidationRule()
}
